<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang = "zh-CN">
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Title</title>
    <script src="/sb/js/jquery-1.8.3.js"></script>
</head>
<body>
<center>

<h3>员工列表</h3>
<table border="1">
    <thead><th>员工编号</th><th>姓名</th><th> 工作 </th><th>薪水</th><th> 雇佣日期</th></thead>
    <tbody id="tb"></tbody>
</table>
</center>
<script>

    $(function(){
        $.ajax({
            url:"/sb/emp/proList",
            data:{deptNo:20},
            type:"post",
            dataType:"json",
            success:function(data) {
                var str = '';
                alert(data);
                for (var i = 0; i < data.length; i++) {
                    str += "<tr><td>"+data[i].empNo+"</td><td>"+data[i].ename+"</td><td>"+data[i].job+"</td><td>"+data[i].salary+"</td><td>"+data[i].hireDate+"</td></tr>"
                }
                $("#tb").append(str);
            }
        });

    });
</script>
</body>
</html>